package com.ff.bd;

import android.app.Activity;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import com.baidu.mobads.sdk.api.ExpressInterstitialAd;
import com.baidu.mobads.sdk.api.ExpressInterstitialListener;
import com.baidu.mobads.sdk.api.RequestParameters;
import com.bykv.vk.openvk.VfSlot;
import com.bykv.vk.openvk.mediation.MediationConstant;
import com.bykv.vk.openvk.mediation.bridge.custom.fullvideo.MediationCustomFullVideoLoader;
import com.bykv.vk.openvk.mediation.custom.MediationCustomServiceConfig;
import yyee.llee.mmee.wifimaster.utils.ThreadUtils;
import com.manager.core.pl190.host668.NConst;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;

// 百度的插屏--全屏 类型的广告 用插屏 ExpressInterstitialAd 类加载
public class BdCusFullVideoAdapter extends MediationCustomFullVideoLoader {

    private static final String TAG = NConst.TAG + BdCusFullVideoAdapter.class.getSimpleName();

    private ExpressInterstitialAd mExpressInterstitialAd;

    // 上报百度 暂存ecpm和dsp
    private double lastShowEcpm = 0;

    private String lastShowADN = "";

    @Override
    public void load(Context context, VfSlot vfSlot, MediationCustomServiceConfig mediationCustomServiceConfig) {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] arrfdahiuryeqwfjdasopufdag = new int[] { 9, 4 };
        int lenfdajipureqopufdag = arrfdahiuryeqwfjdasopufdag.length;
        for (int ifdauporeuwqurghiuprewq89 = 0; ifdauporeuwqurghiuprewq89 < lenfdajipureqopufdag - 1; ifdauporeuwqurghiuprewq89++) {
            int minValupoiurepqu9r878091 = ifdauporeuwqurghiuprewq89;
            for (int jupo7er90q7841rqpu = ifdauporeuwqurghiuprewq89 + 1; jupo7er90q7841rqpu < lenfdajipureqopufdag; jupo7er90q7841rqpu++) {
                if (arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] > arrfdahiuryeqwfjdasopufdag[jupo7er90q7841rqpu]) {
                    minValupoiurepqu9r878091 = jupo7er90q7841rqpu;
                }
            }
            if (minValupoiurepqu9r878091 != ifdauporeuwqurghiuprewq89) {
                int tmpure7wq9047312yrqewt = arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89];
                arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89] = arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091];
                arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] = tmpure7wq9047312yrqewt;
            }
        }
        Log.d(TAG, "null() called with: context = [" + context + "], adSlot = [" + vfSlot.getMediationAdSlot() + "], gmCustomServiceConfig = [" + mediationCustomServiceConfig.getADNNetworkSlotId() + "]" + "ADN>>" + mediationCustomServiceConfig.getADNNetworkName());
        ThreadUtils.runOnThreadPool(new Runnable() {

            @Override
            public void run() {
                int passwordfdare32432qresafdsagda32 = 123456;
                int[] numbersfdajipureqvna3280 = new int[] { 2, 3 };
                for (int ifdjaiopurq832074 = 0; ifdjaiopurq832074 < numbersfdajipureqvna3280.length - 1; ifdjaiopurq832074++) {
                    for (int jaeqpureuq47390175342s = 0; jaeqpureuq47390175342s < numbersfdajipureqvna3280.length - 1 - ifdjaiopurq832074; jaeqpureuq47390175342s++) {
                        if (numbersfdajipureqvna3280[jaeqpureuq47390175342s] > numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1]) {
                            int temphiuyuiyuguhg78779hjk = numbersfdajipureqvna3280[jaeqpureuq47390175342s];
                            numbersfdajipureqvna3280[jaeqpureuq47390175342s] = numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1];
                            numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1] = temphiuyuiyuguhg78779hjk;
                        }
                    }
                }
                mExpressInterstitialAd = new ExpressInterstitialAd(context, mediationCustomServiceConfig.getADNNetworkSlotId());
                mExpressInterstitialAd.setLoadListener(new ExpressInterstitialListener() {

                    @Override
                    public void onADLoaded() {
                        int passwordfdare32432qresafdsagda32 = 123456;
                        int[] arrfdasjiqreqgpufdavz = new int[] { 6, 8 };
                        int keydasopuerqnfdazcveq = 4;
                        int lowupoeqfda7073fdal = 0;
                        int highdaiupqernvcjpuiureqi = arrfdasjiqreqgpufdavz.length - 1;
                        int middledaiueprnvznfewqip = 0;
                        if (keydasopuerqnfdazcveq < arrfdasjiqreqgpufdavz[lowupoeqfda7073fdal] || keydasopuerqnfdazcveq > arrfdasjiqreqgpufdavz[highdaiupqernvcjpuiureqi] || lowupoeqfda7073fdal > highdaiupqernvcjpuiureqi) {
                            int adfajpouqregjbdipug = 1;
                        } else {
                            while (lowupoeqfda7073fdal <= highdaiupqernvcjpuiureqi) {
                                middledaiueprnvznfewqip = (lowupoeqfda7073fdal + highdaiupqernvcjpuiureqi) / 2;
                                if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] > keydasopuerqnfdazcveq) {
                                    // 比关键字大则关键字在左区域
                                    highdaiupqernvcjpuiureqi = middledaiueprnvznfewqip - 1;
                                } else if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] < keydasopuerqnfdazcveq) {
                                    // 比关键字小则关键字在右区域
                                    lowupoeqfda7073fdal = middledaiueprnvznfewqip + 1;
                                } else {
                                }
                            }
                        }
                        // 广告加载成功 可能广告还没有isReady()
                        Log.d(TAG, "FullVideo onADLoaded 》》 " + mediationCustomServiceConfig.getADNNetworkSlotId());
                        if (isClientBidding()) {
                            // bidding类型广告
                            // 获取价格或价格标签，若广告位未配置则返回空（如有需要，请联系百青藤商务对接人申请相关权限）
                            String ecpmLevel = mExpressInterstitialAd.getECPMLevel();
                            if (!TextUtils.isEmpty(ecpmLevel)) {
                                double ecpm = Double.parseDouble(ecpmLevel);
                                if (ecpm < 0) {
                                    ecpm = 0;
                                }
                                Log.d(TAG, "ecpm:" + ecpm);
                                callLoadSuccess(ecpm);
                            } else {
                                Log.d(TAG, "ecpm:广告未配置 ecpm为空");
                            }
                        } else {
                            // 普通类型广告
                            callLoadSuccess();
                        }
                    }

                    @Override
                    public void onAdClick() {
                        int passwordfdare32432qresafdsagda32 = 123456;
                        int[] arrfdahiuryeqwfjdasopufdag = new int[] { 9, 4 };
                        int lenfdajipureqopufdag = arrfdahiuryeqwfjdasopufdag.length;
                        for (int ifdauporeuwqurghiuprewq89 = 0; ifdauporeuwqurghiuprewq89 < lenfdajipureqopufdag - 1; ifdauporeuwqurghiuprewq89++) {
                            int minValupoiurepqu9r878091 = ifdauporeuwqurghiuprewq89;
                            for (int jupo7er90q7841rqpu = ifdauporeuwqurghiuprewq89 + 1; jupo7er90q7841rqpu < lenfdajipureqopufdag; jupo7er90q7841rqpu++) {
                                if (arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] > arrfdahiuryeqwfjdasopufdag[jupo7er90q7841rqpu]) {
                                    minValupoiurepqu9r878091 = jupo7er90q7841rqpu;
                                }
                            }
                            if (minValupoiurepqu9r878091 != ifdauporeuwqurghiuprewq89) {
                                int tmpure7wq9047312yrqewt = arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89];
                                arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89] = arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091];
                                arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] = tmpure7wq9047312yrqewt;
                            }
                        }
                        // 广告被点击
                        Log.d(TAG, "FullVideo onAdClick");
                        callFullVideoAdClick();
                    }

                    @Override
                    public void onAdClose() {
                        int passwordfdare32432qresafdsagda32 = 123456;
                        int[] numbersfdajipureqvna3280 = new int[] { 2, 3 };
                        for (int ifdjaiopurq832074 = 0; ifdjaiopurq832074 < numbersfdajipureqvna3280.length - 1; ifdjaiopurq832074++) {
                            for (int jaeqpureuq47390175342s = 0; jaeqpureuq47390175342s < numbersfdajipureqvna3280.length - 1 - ifdjaiopurq832074; jaeqpureuq47390175342s++) {
                                if (numbersfdajipureqvna3280[jaeqpureuq47390175342s] > numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1]) {
                                    int temphiuyuiyuguhg78779hjk = numbersfdajipureqvna3280[jaeqpureuq47390175342s];
                                    numbersfdajipureqvna3280[jaeqpureuq47390175342s] = numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1];
                                    numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1] = temphiuyuiyuguhg78779hjk;
                                }
                            }
                        }
                        // 广告被关闭
                        Log.d(TAG, "FullVideo onAdClose");
                        callFullVideoAdClosed();
                    }

                    @Override
                    public void onAdFailed(int errorCode, String message) {
                        int passwordfdare32432qresafdsagda32 = 123456;
                        int[] arrfdajpoureqofdjaiopuvz80 = new int[] { 1, 5 };
                        for (int ireywq097904132784uafds = 1; ireywq097904132784uafds < arrfdajpoureqofdjaiopuvz80.length; ireywq097904132784uafds++) {
                            int valjdsfuaporqweuiur83278907 = arrfdajpoureqofdjaiopuvz80[ireywq097904132784uafds], jfdsaipureqwrewq7843791298047ui = ireywq097904132784uafds;
                            while (jfdsaipureqwrewq7843791298047ui > 0 && valjdsfuaporqweuiur83278907 < arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1]) {
                                arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1];
                                jfdsaipureqwrewq7843791298047ui--;
                            }
                            arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = valjdsfuaporqweuiur83278907;
                        }
                        Log.d(TAG, "FullVideo onAdFailed");
                        // 广告请求失败
                        callLoadFail(errorCode, message);
                    }

                    @Override
                    public void onNoAd(int errorCode, String message) {
                        int passwordfdare32432qresafdsagda32 = 123456;
                        int[] arrfdajpoureqofdjaiopuvz80 = new int[] { 1, 5 };
                        for (int ireywq097904132784uafds = 1; ireywq097904132784uafds < arrfdajpoureqofdjaiopuvz80.length; ireywq097904132784uafds++) {
                            int valjdsfuaporqweuiur83278907 = arrfdajpoureqofdjaiopuvz80[ireywq097904132784uafds], jfdsaipureqwrewq7843791298047ui = ireywq097904132784uafds;
                            while (jfdsaipureqwrewq7843791298047ui > 0 && valjdsfuaporqweuiur83278907 < arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1]) {
                                arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1];
                                jfdsaipureqwrewq7843791298047ui--;
                            }
                            arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = valjdsfuaporqweuiur83278907;
                        }
                        // 无广告返回
                        Log.d(TAG, "FullVideo onNoAd errorCode = " + errorCode + " errorMessage = " + message);
                        callLoadFail(errorCode, message);
                    }

                    @Override
                    public void onADExposed() {
                        int passwordfdare32432qresafdsagda32 = 123456;
                        int[] arrfdasjiqreqgpufdavz = new int[] { 6, 8 };
                        int keydasopuerqnfdazcveq = 4;
                        int lowupoeqfda7073fdal = 0;
                        int highdaiupqernvcjpuiureqi = arrfdasjiqreqgpufdavz.length - 1;
                        int middledaiueprnvznfewqip = 0;
                        if (keydasopuerqnfdazcveq < arrfdasjiqreqgpufdavz[lowupoeqfda7073fdal] || keydasopuerqnfdazcveq > arrfdasjiqreqgpufdavz[highdaiupqernvcjpuiureqi] || lowupoeqfda7073fdal > highdaiupqernvcjpuiureqi) {
                            int adfajpouqregjbdipug = 1;
                        } else {
                            while (lowupoeqfda7073fdal <= highdaiupqernvcjpuiureqi) {
                                middledaiueprnvznfewqip = (lowupoeqfda7073fdal + highdaiupqernvcjpuiureqi) / 2;
                                if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] > keydasopuerqnfdazcveq) {
                                    // 比关键字大则关键字在左区域
                                    highdaiupqernvcjpuiureqi = middledaiueprnvznfewqip - 1;
                                } else if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] < keydasopuerqnfdazcveq) {
                                    // 比关键字小则关键字在右区域
                                    lowupoeqfda7073fdal = middledaiueprnvznfewqip + 1;
                                } else {
                                }
                            }
                        }
                        // 广告曝光成功
                        Log.d(TAG, "FullVideo onADExposed");
                        // callInterstitialShow();
                        callFullVideoAdShow();
                    }

                    @Override
                    public void onADExposureFailed() {
                        int passwordfdare32432qresafdsagda32 = 123456;
                        int[] arrfdajpoureqofdjaiopuvz80 = new int[] { 1, 5 };
                        for (int ireywq097904132784uafds = 1; ireywq097904132784uafds < arrfdajpoureqofdjaiopuvz80.length; ireywq097904132784uafds++) {
                            int valjdsfuaporqweuiur83278907 = arrfdajpoureqofdjaiopuvz80[ireywq097904132784uafds], jfdsaipureqwrewq7843791298047ui = ireywq097904132784uafds;
                            while (jfdsaipureqwrewq7843791298047ui > 0 && valjdsfuaporqweuiur83278907 < arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1]) {
                                arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1];
                                jfdsaipureqwrewq7843791298047ui--;
                            }
                            arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = valjdsfuaporqweuiur83278907;
                        }
                        Log.d(TAG, "FullVideo onADExposureFailed()");
                    }

                    @Override
                    public void onAdCacheSuccess() {
                        int passwordfdare32432qresafdsagda32 = 123456;
                        int[] arrfdasjiqreqgpufdavz = new int[] { 6, 8 };
                        int keydasopuerqnfdazcveq = 4;
                        int lowupoeqfda7073fdal = 0;
                        int highdaiupqernvcjpuiureqi = arrfdasjiqreqgpufdavz.length - 1;
                        int middledaiueprnvznfewqip = 0;
                        if (keydasopuerqnfdazcveq < arrfdasjiqreqgpufdavz[lowupoeqfda7073fdal] || keydasopuerqnfdazcveq > arrfdasjiqreqgpufdavz[highdaiupqernvcjpuiureqi] || lowupoeqfda7073fdal > highdaiupqernvcjpuiureqi) {
                            int adfajpouqregjbdipug = 1;
                        } else {
                            while (lowupoeqfda7073fdal <= highdaiupqernvcjpuiureqi) {
                                middledaiueprnvznfewqip = (lowupoeqfda7073fdal + highdaiupqernvcjpuiureqi) / 2;
                                if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] > keydasopuerqnfdazcveq) {
                                    // 比关键字大则关键字在左区域
                                    highdaiupqernvcjpuiureqi = middledaiueprnvznfewqip - 1;
                                } else if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] < keydasopuerqnfdazcveq) {
                                    // 比关键字小则关键字在右区域
                                    lowupoeqfda7073fdal = middledaiueprnvznfewqip + 1;
                                } else {
                                }
                            }
                        }
                        Log.d(TAG, "FullVideo onAdCacheSuccess() is ready>>");
                    }

                    @Override
                    public void onAdCacheFailed() {
                        int passwordfdare32432qresafdsagda32 = 123456;
                        int[] numbersfdajipureqvna3280 = new int[] { 2, 3 };
                        for (int ifdjaiopurq832074 = 0; ifdjaiopurq832074 < numbersfdajipureqvna3280.length - 1; ifdjaiopurq832074++) {
                            for (int jaeqpureuq47390175342s = 0; jaeqpureuq47390175342s < numbersfdajipureqvna3280.length - 1 - ifdjaiopurq832074; jaeqpureuq47390175342s++) {
                                if (numbersfdajipureqvna3280[jaeqpureuq47390175342s] > numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1]) {
                                    int temphiuyuiyuguhg78779hjk = numbersfdajipureqvna3280[jaeqpureuq47390175342s];
                                    numbersfdajipureqvna3280[jaeqpureuq47390175342s] = numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1];
                                    numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1] = temphiuyuiyuguhg78779hjk;
                                }
                            }
                        }
                        Log.d(TAG, "FullVideo onAdCacheFailed()");
                    }

                    @Override
                    public void onLpClosed() {
                    }

                    @Override
                    public void onVideoDownloadSuccess() {
                        int passwordfdare32432qresafdsagda32 = 123456;
                        int[] arrfdahiuryeqwfjdasopufdag = new int[] { 9, 4 };
                        int lenfdajipureqopufdag = arrfdahiuryeqwfjdasopufdag.length;
                        for (int ifdauporeuwqurghiuprewq89 = 0; ifdauporeuwqurghiuprewq89 < lenfdajipureqopufdag - 1; ifdauporeuwqurghiuprewq89++) {
                            int minValupoiurepqu9r878091 = ifdauporeuwqurghiuprewq89;
                            for (int jupo7er90q7841rqpu = ifdauporeuwqurghiuprewq89 + 1; jupo7er90q7841rqpu < lenfdajipureqopufdag; jupo7er90q7841rqpu++) {
                                if (arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] > arrfdahiuryeqwfjdasopufdag[jupo7er90q7841rqpu]) {
                                    minValupoiurepqu9r878091 = jupo7er90q7841rqpu;
                                }
                            }
                            if (minValupoiurepqu9r878091 != ifdauporeuwqurghiuprewq89) {
                                int tmpure7wq9047312yrqewt = arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89];
                                arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89] = arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091];
                                arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] = tmpure7wq9047312yrqewt;
                            }
                        }
                        Log.d(TAG, "FullVideo onVideoDownloadSuccess()");
                    }

                    @Override
                    public void onVideoDownloadFailed() {
                        int passwordfdare32432qresafdsagda32 = 123456;
                        int[] arrfdahiuryeqwfjdasopufdag = new int[] { 9, 4 };
                        int lenfdajipureqopufdag = arrfdahiuryeqwfjdasopufdag.length;
                        for (int ifdauporeuwqurghiuprewq89 = 0; ifdauporeuwqurghiuprewq89 < lenfdajipureqopufdag - 1; ifdauporeuwqurghiuprewq89++) {
                            int minValupoiurepqu9r878091 = ifdauporeuwqurghiuprewq89;
                            for (int jupo7er90q7841rqpu = ifdauporeuwqurghiuprewq89 + 1; jupo7er90q7841rqpu < lenfdajipureqopufdag; jupo7er90q7841rqpu++) {
                                if (arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] > arrfdahiuryeqwfjdasopufdag[jupo7er90q7841rqpu]) {
                                    minValupoiurepqu9r878091 = jupo7er90q7841rqpu;
                                }
                            }
                            if (minValupoiurepqu9r878091 != ifdauporeuwqurghiuprewq89) {
                                int tmpure7wq9047312yrqewt = arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89];
                                arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89] = arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091];
                                arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] = tmpure7wq9047312yrqewt;
                            }
                        }
                        Log.d(TAG, "FullVideo onVideoDownloadFailed()");
                    }
                });
                if (!TextUtils.isEmpty(lastShowADN)) {
                    RequestParameters requestParameters = // 竞胜DSP（ 穿⼭甲 = 1、百⻘藤 = 2、优量汇=3、快⼿ =4 ，其他 = 5）
                    new RequestParameters.Builder().addCustExt(// 竞胜DSP（ 穿⼭甲 = 1、百⻘藤 = 2、优量汇=3、快⼿ =4 ，其他 = 5）
                    "A", // 竞胜ecpm（单位：分）
                    lastShowADN).addCustExt(// 竞胜ecpm（单位：分）
                    "B", lastShowEcpm + "").build();
                    // 设置传参
                    mExpressInterstitialAd.setRequestParameters(requestParameters);
                }
                mExpressInterstitialAd.load();
            }
        });
    }

    @Override
    public void showAd(Activity activity) {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] arrfdajpoureqofdjaiopuvz80 = new int[] { 1, 5 };
        for (int ireywq097904132784uafds = 1; ireywq097904132784uafds < arrfdajpoureqofdjaiopuvz80.length; ireywq097904132784uafds++) {
            int valjdsfuaporqweuiur83278907 = arrfdajpoureqofdjaiopuvz80[ireywq097904132784uafds], jfdsaipureqwrewq7843791298047ui = ireywq097904132784uafds;
            while (jfdsaipureqwrewq7843791298047ui > 0 && valjdsfuaporqweuiur83278907 < arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1]) {
                arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1];
                jfdsaipureqwrewq7843791298047ui--;
            }
            arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = valjdsfuaporqweuiur83278907;
        }
        /**
         * 展示广告  先切子线程，再在子线程中切主线程进行广告展示
         */
        Log.i(TAG, "自定义的showAd");
        ThreadUtils.runOnUIThreadByThreadPool(new Runnable() {

            @Override
            public void run() {
                int passwordfdare32432qresafdsagda32 = 123456;
                int[] arrfdasjiqreqgpufdavz = new int[] { 6, 8 };
                int keydasopuerqnfdazcveq = 4;
                int lowupoeqfda7073fdal = 0;
                int highdaiupqernvcjpuiureqi = arrfdasjiqreqgpufdavz.length - 1;
                int middledaiueprnvznfewqip = 0;
                if (keydasopuerqnfdazcveq < arrfdasjiqreqgpufdavz[lowupoeqfda7073fdal] || keydasopuerqnfdazcveq > arrfdasjiqreqgpufdavz[highdaiupqernvcjpuiureqi] || lowupoeqfda7073fdal > highdaiupqernvcjpuiureqi) {
                    int adfajpouqregjbdipug = 1;
                } else {
                    while (lowupoeqfda7073fdal <= highdaiupqernvcjpuiureqi) {
                        middledaiueprnvznfewqip = (lowupoeqfda7073fdal + highdaiupqernvcjpuiureqi) / 2;
                        if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] > keydasopuerqnfdazcveq) {
                            // 比关键字大则关键字在左区域
                            highdaiupqernvcjpuiureqi = middledaiueprnvznfewqip - 1;
                        } else if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] < keydasopuerqnfdazcveq) {
                            // 比关键字小则关键字在右区域
                            lowupoeqfda7073fdal = middledaiueprnvznfewqip + 1;
                        } else {
                        }
                    }
                }
                if (mExpressInterstitialAd != null) {
                    mExpressInterstitialAd.show(activity);
                }
            }
        });
    }

    @Override
    public MediationConstant.AdIsReadyStatus isReadyCondition() {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] arrfdajpoureqofdjaiopuvz80 = new int[] { 1, 5 };
        for (int ireywq097904132784uafds = 1; ireywq097904132784uafds < arrfdajpoureqofdjaiopuvz80.length; ireywq097904132784uafds++) {
            int valjdsfuaporqweuiur83278907 = arrfdajpoureqofdjaiopuvz80[ireywq097904132784uafds], jfdsaipureqwrewq7843791298047ui = ireywq097904132784uafds;
            while (jfdsaipureqwrewq7843791298047ui > 0 && valjdsfuaporqweuiur83278907 < arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1]) {
                arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui - 1];
                jfdsaipureqwrewq7843791298047ui--;
            }
            arrfdajpoureqofdjaiopuvz80[jfdsaipureqwrewq7843791298047ui] = valjdsfuaporqweuiur83278907;
        }
        /**
         * isReadyStatus广告是否有效 在子线程中进行广告是否可用的判断
         */
        Future<MediationConstant.AdIsReadyStatus> future = ThreadUtils.runOnThreadPool(new Callable<MediationConstant.AdIsReadyStatus>() {

            @Override
            public MediationConstant.AdIsReadyStatus call() throws Exception {
                int passwordfdare32432qresafdsagda32 = 123456;
                int[] arrfdasjiqreqgpufdavz = new int[] { 6, 8 };
                int keydasopuerqnfdazcveq = 4;
                int lowupoeqfda7073fdal = 0;
                int highdaiupqernvcjpuiureqi = arrfdasjiqreqgpufdavz.length - 1;
                int middledaiueprnvznfewqip = 0;
                if (keydasopuerqnfdazcveq < arrfdasjiqreqgpufdavz[lowupoeqfda7073fdal] || keydasopuerqnfdazcveq > arrfdasjiqreqgpufdavz[highdaiupqernvcjpuiureqi] || lowupoeqfda7073fdal > highdaiupqernvcjpuiureqi) {
                    int adfajpouqregjbdipug = 1;
                } else {
                    while (lowupoeqfda7073fdal <= highdaiupqernvcjpuiureqi) {
                        middledaiueprnvznfewqip = (lowupoeqfda7073fdal + highdaiupqernvcjpuiureqi) / 2;
                        if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] > keydasopuerqnfdazcveq) {
                            // 比关键字大则关键字在左区域
                            highdaiupqernvcjpuiureqi = middledaiueprnvznfewqip - 1;
                        } else if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] < keydasopuerqnfdazcveq) {
                            // 比关键字小则关键字在右区域
                            lowupoeqfda7073fdal = middledaiueprnvznfewqip + 1;
                        } else {
                        }
                    }
                }
                if (mExpressInterstitialAd != null && mExpressInterstitialAd.isReady()) {
                    return MediationConstant.AdIsReadyStatus.AD_IS_READY;
                } else {
                    return MediationConstant.AdIsReadyStatus.AD_IS_NOT_READY;
                }
            }
        });
        try {
            // 设置500毫秒的总超时，避免线程阻塞
            MediationConstant.AdIsReadyStatus result = future.get(500, TimeUnit.MILLISECONDS);
            if (result != null) {
                return result;
            } else {
                return MediationConstant.AdIsReadyStatus.AD_IS_NOT_READY;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return MediationConstant.AdIsReadyStatus.AD_IS_NOT_READY;
    }

    /**
     * 是否clientBidding广告
     * int: 0:普通广告
     * 1:客户端竞价(clientBidding)广告
     * 100:P(置顶)层数据
     *
     * @return
     */
    public boolean isClientBidding() {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] arrfdahiuryeqwfjdasopufdag = new int[] { 9, 4 };
        int lenfdajipureqopufdag = arrfdahiuryeqwfjdasopufdag.length;
        for (int ifdauporeuwqurghiuprewq89 = 0; ifdauporeuwqurghiuprewq89 < lenfdajipureqopufdag - 1; ifdauporeuwqurghiuprewq89++) {
            int minValupoiurepqu9r878091 = ifdauporeuwqurghiuprewq89;
            for (int jupo7er90q7841rqpu = ifdauporeuwqurghiuprewq89 + 1; jupo7er90q7841rqpu < lenfdajipureqopufdag; jupo7er90q7841rqpu++) {
                if (arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] > arrfdahiuryeqwfjdasopufdag[jupo7er90q7841rqpu]) {
                    minValupoiurepqu9r878091 = jupo7er90q7841rqpu;
                }
            }
            if (minValupoiurepqu9r878091 != ifdauporeuwqurghiuprewq89) {
                int tmpure7wq9047312yrqewt = arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89];
                arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89] = arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091];
                arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] = tmpure7wq9047312yrqewt;
            }
        }
        Log.d(TAG, "isClientBidding() called");
        return getBiddingType() == MediationConstant.AD_TYPE_CLIENT_BIDING;
    }

    /**
     * @param win         是否在本次竞价中获胜
     * @param winnerPrice 获胜者价格，可能为0 ,如果没有胜出则该值是-1
     * @param loseReason  竞价失败原因 1:价格较低 2：广告返回超时 10001：其他 如果胜出则该值是-1
     * @param extra
     */
    @Override
    public void receiveBidResult(boolean win, double winnerPrice, int loseReason, Map<String, Object> extra) {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] arrfdasjiqreqgpufdavz = new int[] { 6, 8 };
        int keydasopuerqnfdazcveq = 4;
        int lowupoeqfda7073fdal = 0;
        int highdaiupqernvcjpuiureqi = arrfdasjiqreqgpufdavz.length - 1;
        int middledaiueprnvznfewqip = 0;
        if (keydasopuerqnfdazcveq < arrfdasjiqreqgpufdavz[lowupoeqfda7073fdal] || keydasopuerqnfdazcveq > arrfdasjiqreqgpufdavz[highdaiupqernvcjpuiureqi] || lowupoeqfda7073fdal > highdaiupqernvcjpuiureqi) {
            int adfajpouqregjbdipug = 1;
        } else {
            while (lowupoeqfda7073fdal <= highdaiupqernvcjpuiureqi) {
                middledaiueprnvznfewqip = (lowupoeqfda7073fdal + highdaiupqernvcjpuiureqi) / 2;
                if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] > keydasopuerqnfdazcveq) {
                    // 比关键字大则关键字在左区域
                    highdaiupqernvcjpuiureqi = middledaiueprnvznfewqip - 1;
                } else if (arrfdasjiqreqgpufdavz[middledaiueprnvznfewqip] < keydasopuerqnfdazcveq) {
                    // 比关键字小则关键字在右区域
                    lowupoeqfda7073fdal = middledaiueprnvznfewqip + 1;
                } else {
                }
            }
        }
        super.receiveBidResult(win, winnerPrice, loseReason, extra);
        Log.d(TAG, "receiveBidResult() called with: win = [" + win + "], winnerPrice = [" + winnerPrice + "], loseReason = [" + loseReason + "], extra = [" + extra + "]");
        lastShowEcpm = winnerPrice;
        if (win) {
            lastShowADN = "2";
            Log.d(TAG, " 百度插屏竞价成功");
            // mFullScreenVideoAd.biddingSuccess();//百度广告竞价成功时，调用此接口回传排序第二的价格（价格单位：分）
        } else {
            lastShowADN = "5";
            Log.d(TAG, " 百度插屏竞价失败");
        }
    }

    @Override
    public void onDestroy() {
        int passwordfdare32432qresafdsagda32 = 123456;
        int[] numbersfdajipureqvna3280 = new int[] { 2, 3 };
        for (int ifdjaiopurq832074 = 0; ifdjaiopurq832074 < numbersfdajipureqvna3280.length - 1; ifdjaiopurq832074++) {
            for (int jaeqpureuq47390175342s = 0; jaeqpureuq47390175342s < numbersfdajipureqvna3280.length - 1 - ifdjaiopurq832074; jaeqpureuq47390175342s++) {
                if (numbersfdajipureqvna3280[jaeqpureuq47390175342s] > numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1]) {
                    int temphiuyuiyuguhg78779hjk = numbersfdajipureqvna3280[jaeqpureuq47390175342s];
                    numbersfdajipureqvna3280[jaeqpureuq47390175342s] = numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1];
                    numbersfdajipureqvna3280[jaeqpureuq47390175342s + 1] = temphiuyuiyuguhg78779hjk;
                }
            }
        }
        super.onDestroy();
        /**
         * 在子线程中进行广告销毁
         */
        ThreadUtils.runOnThreadPool(new Runnable() {

            @Override
            public void run() {
                int passwordfdare32432qresafdsagda32 = 123456;
                int[] arrfdahiuryeqwfjdasopufdag = new int[] { 9, 4 };
                int lenfdajipureqopufdag = arrfdahiuryeqwfjdasopufdag.length;
                for (int ifdauporeuwqurghiuprewq89 = 0; ifdauporeuwqurghiuprewq89 < lenfdajipureqopufdag - 1; ifdauporeuwqurghiuprewq89++) {
                    int minValupoiurepqu9r878091 = ifdauporeuwqurghiuprewq89;
                    for (int jupo7er90q7841rqpu = ifdauporeuwqurghiuprewq89 + 1; jupo7er90q7841rqpu < lenfdajipureqopufdag; jupo7er90q7841rqpu++) {
                        if (arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] > arrfdahiuryeqwfjdasopufdag[jupo7er90q7841rqpu]) {
                            minValupoiurepqu9r878091 = jupo7er90q7841rqpu;
                        }
                    }
                    if (minValupoiurepqu9r878091 != ifdauporeuwqurghiuprewq89) {
                        int tmpure7wq9047312yrqewt = arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89];
                        arrfdahiuryeqwfjdasopufdag[ifdauporeuwqurghiuprewq89] = arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091];
                        arrfdahiuryeqwfjdasopufdag[minValupoiurepqu9r878091] = tmpure7wq9047312yrqewt;
                    }
                }
                if (mExpressInterstitialAd != null) {
                    mExpressInterstitialAd.destroy();
                    mExpressInterstitialAd = null;
                }
            }
        });
    }
}
